//
//   Copyright 2011 Gynvael Coldwind & Mateusz "j00ru" Jurczyk
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
//
#pragma once

enum OBJECT_TYPE
{
  OBJECT_TYPE_SPELL_BULLET    = 0x01,
  OBJECT_TYPE_SPELL_FIREBALL  = 0x02,
  OBJECT_TYPE_SPELL_TELEPORT  = 0x04,
  OBJECT_TYPE_SPELL_BRIDGE    = 0x08,
  OBJECT_TYPE_SPELL_FIVE      = 0x10,
  OBJECT_TYPE_SPELL_SIX       = 0x20
  // ...
};

typedef struct tagOBJECT_SPELL_BULLET
{
  float vx, vy;
} OBJECT_SPELL_BULLET;

typedef struct tagOBJECT_SPELL_FIREBALL
{
  float vx, vy;
} OBJECT_SPELL_FIREBALL;

typedef struct tagOBJECT_SPELL_TELEPORT
{
  int pos[2][2]; // [start=0 end=1][x=0 y=1]

  // TODO: add more entries
} OBJECT_SPELL_TELEPORT;

typedef struct tagOBJECT_SPELL_BRIDGE
{
  int pos[2]; // [x=0 y=1]

  // TODO: add more entries
} OBJECT_SPELL_BRIDGE;


typedef struct tagOBJECT_STRUCT
{
  enum OBJECT_TYPE type;
  float x, y;
  float w, h;
  int map_id; // on what map are you?

  union
  {
    OBJECT_SPELL_BULLET   spellBullet;
    OBJECT_SPELL_FIREBALL spellFireball;
    OBJECT_SPELL_TELEPORT spellTeleport;
    OBJECT_SPELL_BRIDGE   spellBridge;
  } u;
} OBJECT_STRUCT;

void object_Insert(OBJECT_STRUCT* object);
OBJECT_STRUCT* object_CreateBullet(float x, float y, int map_id, float vx, float vy);
OBJECT_STRUCT* object_CreateFireball(float x, float y, int map_id, float vx, float vy);


